#ifndef _GOVT_PROFESSIONS_H_
#define _GOVT_PROFESSIONS_H_
/*******************************************************************************
 ** Name: professions.hpp                                                     **
 ** Description: Timer and timing objects.                                    **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 ** The contents of this file are subject to the terms of the                 **
 ** Common Development and Distribution License, Version 1.0 only             **
 ** (the "License").  You may not use this file except in compliance          **
 ** with the License.                                                         **
 **                                                                           **
 ** You can find a copy of the license in the LICENSE file within             **
 ** this distribution or at $WIKI/display/GOVT/License-software.              **
 ** Software distributed under the License is distributed on an "AS IS"       **
 ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.           **
 ** See the License for the specific language governing permissions           **
 ** and limitations under the License.                                        **
 **                                                                           **
 ** When distributing Covered Code, include this CDDL header in each          **
 ** file and include the License file at $GAME_DIR/LICENSE.                   **
 ** If applicable, add the following below this header, with the indicated    **
 ** fields enclosed by brackets "[]" replaced with your own identifying       **
 ** information: Portions Copyright [yyyy] [name of copyright owner]          **
 **                                                                           **
 **                                                                           **
 ** Copyright (c) 2009-2011  Barry Gian James <gian@gamingods.net>            **
 ** All rights reserved.                                                      **
 ******************************************************************************/
// Created on March 16, 2010, 9:45 PM
// Portions Copyright 2012 Open Design Strategies, LLC
// All Rights Reserved.
// Modified $Date: 2012-07-27 19:06:32 -0600 (Fri, 27 Jul 2012) $ by $Author: unknown $
#define professions_h_ID    "$Id: professions.hpp 68814 2012-07-28 01:06:32Z unknown $"

#include <vector>
#include <odb/core.hxx>
#include <boost/shared_ptr.hpp>
#include "stat.hpp"

namespace profession
{
//! the first value is its build cost (for balancing)
//! there are two types and three speeds of lists
extern int very_slow[];
extern int slow[];
extern int slow_medium[];

extern int fast_medium[];
extern int fast[];
extern int very_fast[];


enum class LevelProgression
{
	Fort, Reflex, Will, Recovery, Avd, Renown
};

enum class type { basic, advanced, master };

}	/* namespace profession */

#pragma db value
struct ProfBonusTable
{
	//#pragma db id
	unsigned int lvl_;
	unsigned int avd_;
	unsigned int fort_;
	unsigned int will_;
	unsigned int reflex_;
	unsigned int recovery_;
};


#pragma db object polymorphic pointer (boost::shared_ptr)
class Profession
{
public:
	Profession() { }
	Profession(const std::string & n);
	virtual ~Profession() { }

	std::string		Name() const { return name_; }
	unsigned int	SkillMod() const { return skillDepMod_; }
	unsigned int	WpnProficiencies() const { return numWpnProf_; }
	unsigned int	ArmorProficiencies() const { return numArmorProf_; }
	stats::base		BaseStat() const { return baseStat_; }
	unsigned int	VitDie() const { return vd_; }
	unsigned int	MaxLevels() const { return maxLvls_; }
	profession::type	Type() const { return type_; }

	void	WpnProficiencies(unsigned int i) { numWpnProf_ = i; }
	void	ArmorProficiencies(unsigned int i) { numArmorProf_ = i; }
	void	BaseStat(stats::base b) { baseStat_ = b; }
	void	VitDie(unsigned int v) { vd_ = v; }
	void	MaxLevels(unsigned int m) { maxLvls_ = m; }
	void	Type(profession::type t) { type_ = t; }
	void	SkillMod(unsigned int s) { skillDepMod_ = s; }
protected:
	friend class odb::access;

	#pragma db id	auto
	unsigned int	id_;
	std::string		name_;
	unsigned int	skillDepMod_;	// eg 4 * INT mod (it's the 4)
	unsigned int	numWpnProf_;		// number of wpn proficiencies
	unsigned int	numArmorProf_;
	unsigned int 	vd_;		// vit die (ie 6,8,10,12)
	stats::base 		baseStat_;
	unsigned int	maxLvls_;	// how many levels this prof provide?
	profession::type type_;
};

//! @class BasicProfession
//! @brief Class for all basic professions
#pragma db object table("profession_basic")
class BasicProfession : public Profession
{
public:
	BasicProfession() : Profession() { }
	BasicProfession(const std::string &);

private:
	friend class odb::access;

	#pragma db value_not_null
	std::vector<ProfBonusTable> progression_;
};

#pragma db object table("profession_advanced")
class AdvancedProfession : public Profession
{
public:
	AdvancedProfession() : Profession() { }
	AdvancedProfession(const std::string &);

private:
	friend class odb::access;
};

#pragma db object table("profession_master")
class MasterProfession : public Profession
{
public:
	MasterProfession() : Profession() { }

private:
};
#endif	/* _GSANCT_PROFESSIONS_H_ */
